package Hulppakket;


import java.io.Serializable;

public class Point3f extends Tuple3f implements Serializable
{
    /**
     * Constructs and initializes a Point3f to (0,0,0).
     */

    public Point3f()
    {
    }


    /**
     * Constructs and initializes a Point3f from the specified xyz coordinates.
     * @param x
     * @param y
     * @param z
     */
    public Point3f(float x, float y, float z)
    {
        super(x, y, z);
    }


    /**
     * Constructs and initializes a Point3f from the specified Point3f.
     * @param p
     */

    public Point3f(Point3f p)
    {
        super(p);
    }


    /**
     * Constructs and initializes a Point3f from the specified Tuple3f.
     * @param t
     */

    public Point3f(Tuple3f t)
    {
        super(t);
    }


    /**
     * Constructs and initializes a Point3f from the array of length 3.
     * @param p
     */

    public Point3f(float p[])
    {
        super(p);
    }
    /**
     * Subtracting two points gives a vector (with starting point assumed at the origin)
     * @param v1
     * @param v2
     * @return
     */
    public static Vector3f Min(Point3f v1, Point3f v2)
    {
    	Vector3f v = new Vector3f(v1.x-v2.x, v1.y-v2.y,v1.z-v2.z);
    	return v;
    }
    /**
     * Adding a point and a vector gives a new point
     * @param v1
     * @param v2
     * @return
     */
    public static Point3f Plus(Point3f v1, Vector3f v2)
    {
    	Point3f v = new Point3f(v1.x+v2.x, v1.y+v2.y,v1.z+v2.z);
    	return v;
    }

}
